<!--
 * @Author: ‘lishuo’ ‘2486122195@qq.com’
 * @Date: 2023-11-24 21:41:57
 * @LastEditors: ‘lishuo’ ‘2486122195@qq.com’
 * @LastEditTime: 2023-12-02 17:52:09
 * @FilePath: \ruoyi-ui\src\views\index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div>


    <el-row :gutter="20">
      <el-col :span="14">

        <el-card shadow="hover" style="width: 100%; ">
          <div style="width: 100%; display: inline-block;">
            <el-statistic :value="cyxyCount" title="产业学院院长数量：">
            </el-statistic>
          </div>
        </el-card>

        <el-card shadow="hover" style="width: 100%;margin-top: 20px;">
          <div style="width: 100%; display: inline-block; ">
            <el-statistic :value="zjCount" title="专家总数：">

            </el-statistic>
          </div>
        </el-card>
        <el-card shadow="hover" style="width: 100%;margin-top: 20px; ">
          <div style="width: 100%; display: inline-block; ">
            <el-statistic :value="hdCount" title="活动总数：">

            </el-statistic>
          </div>
        </el-card>

      </el-col>
      <el-col :span="10">
        <el-card shadow="hover" style="width: 100%;height: 280px;">
          <div slot="header" class="clearfix" style="text-align: center;font-size: 25px;">
            <span>河北工程技术学院专家管理系统</span>

          </div>


        </el-card>
      </el-col>
    </el-row>

  </div>
</template>
<script>
import { listZhuanjiabiao } from "@/api/system/zhuanjiabiao";
import { listHuodongbiao } from "@/api/system/huodongbiao";
import { listUser } from "@/api/system/user";

export default {
  name: 'index',

  data() {

    return {
      zjCount: 0,//存放专家数量
      hdCount: 0,//存放活动总数量
      cyxyCount: 0,//存放产业学院院长用户数量

    }
  },

  created() {
    this.getcount();
  },
  methods: {


    getcount() {
      this.getZjCount();
      this.getHdCount();
      this.getCyxy();
    },

    /** 查询产业学院院长用户数量 */
    getCyxy() {

      listUser().then(response => {
        this.cyxyCount = response.rows.length - 1;//需要减去唯一的一个管理员用户

      });

    },

    /** 查询专家数量 */
    getZjCount() {
      listZhuanjiabiao().then(response => {
        this.zjCount = response.rows.length;

      });
    },

    /** 查询活动数量 */
    getHdCount() {
      listHuodongbiao().then(response => {
        this.hdCount = response.rows.length;

      });
    },


  }

}



</script>


